#ifndef NEXTDEMO_H
#define NEXTDEMO_H

#include <iostream>
using namespace std;

class Boy;

class Student
{
public:
    Student(Boy *boy);

    string GetName();
    int GetAge();
    void Learn();

private:
    Boy *pHost;
};

class Child
{
public:
    Child(Boy *boy);

    void SetName(string name);
    string GetName();
    void SetAge(int age);
    int GetAge();
    void Eat();

private:
    Boy *pHost;
};

class Boy
{
friend class Student;
friend class Child;
public:
    Student GetStudentRole();
    Child   GetChildRole();

protected:
    void SetName(string name);
    void SetAnge(int age);
    string GetName();
    int GetAge();
    void Eat();
    void Homework();

private:
    string m_name;
    int m_age;
};
#endif // NEXTDEMO_H
